package com.example.mulittenantdemo.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mulittenantdemo.domain.AppVersion;
import com.example.mulittenantdemo.mapper.AppVersionMapper;
import com.example.mulittenantdemo.service.AppVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import  com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;



/**
 * @author 许贵林
 * @description 针对表【app_version(app版本管理)】的数据库操作Service实现
 * @createDate 2024-03-19 09:32:09
 */
@Service
public class AppVersionServiceImpl extends ServiceImpl<AppVersionMapper, AppVersion>
        implements AppVersionService {

    @Autowired
    private AppVersionMapper appVersionMapper;

    @Override
    public AppVersion queryById1(Long id) {
        return appVersionMapper.selectById(id);
    }

    @Override
//    @DS("slave_2")
    public AppVersion queryById2(Long id) {

        return appVersionMapper.selectById(id);
    }

    @Override

    public AppVersion queryById3(Long id,String code) {
//        DynamicDataSourceContextHolder.push(code);
        return appVersionMapper.selectById(id);
    }

    @Override
    public AppVersion queryById4(Long id) {
        return appVersionMapper.selectById(id);
    }

    @Override
//    @DS("primary")
    public AppVersion queryById(Long id) {

        return appVersionMapper.myqueryById111(id);
    }
}




